package com.elink.enginerring.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.elink.enginerring.co.BaseCo;
import com.elink.enginerring.co.ThesisCo;
import com.elink.enginerring.domain.Thesis;
import com.elink.enginerring.vo.ThesisVo;

public interface ThesisMapper {
    int deleteByPrimaryKey(String thesisId);

    int insert(Thesis record);

    int insertSelective(Thesis record);

    Thesis selectByPrimaryKey(String thesisId);

    int updateByPrimaryKeySelective(Thesis record);

    int updateByPrimaryKey(Thesis record);

	List<Thesis> selectList(@Param("co")ThesisCo co);

	int selectCount(@Param("co")ThesisCo co);
	
	Thesis selectByUserId(@Param("userId")String UserId,@Param("thesisId")String thesisId);

	ThesisVo selectInfo(@Param("thesisId")String thesisId, @Param("userId")String userId);

	List<Thesis> getDownLoadRank(int count);

	List<Thesis> selectRelevantList(@Param("tcId")Integer tcId, @Param("scId")Integer scId, @Param("count")int count);

	List<Thesis> getLike(@Param("scId")Integer scId, @Param("count")int count);

	List<Thesis> getUploadByUserId(@Param("co")BaseCo co, @Param("userId")String userId,@Param("keyWord")String keyWord);

	int countUploadByUserId(@Param("userId")String userId,@Param("keyWord")String keyWord);
	
	List<Thesis> getDownLoadByUserId(@Param("co")BaseCo co, @Param("userId")String userId,@Param("keyWord")String keyWord);
	
	int countDownLoadByUserId(@Param("userId")String userId,@Param("keyWord")String keyWord);

	Thesis selectPre(@Param("uploadTime")Date uploadTime);

	Thesis selectNext(@Param("uploadTime")Date uploadTime);

	List<Thesis> getShare(@Param("userId")String userId);	
	
	List<ThesisVo> getMyCollect(@Param("co")BaseCo co,@Param("userId")String userId);
	
	int selectCountMyCollect(@Param("userId")String userId);

	List<Map<String, Object>> selectThesisList(@Param("scId")int scId);

	List<Thesis> selectThesisBest(@Param("count")int count);
}